package cn.tedu.project.oa.base.util;
import org.springframework.security.crypto.bcrypt.BCrypt;


public class PasswordUtil {


    // 生成哈希密码并加盐
    public static String hashPassword(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }

    // 验证密码
    public static boolean checkPassword(String password, String hashedPassword) {
        return BCrypt.checkpw(password, hashedPassword);
    }
}
